<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MTB CAT1 Peripheral driver library: Low Power Callback</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MTB CAT1 Peripheral driver library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__sar__functions__power.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Low Power Callback<div class="ingroups"><a class="el" href="group__group__sar.html">SAR          (SAR ADC Subsystem)</a> &raquo; <a class="el" href="group__group__sar__functions.html">Functions</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p>This set of functions is for Deep Sleep entry and exit. </p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga46e3b5906aad114fb19f15f3ebbc8de2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__syspm__data__enumerates.html#ga601b1cb722cb091133caf33d8ab235ca">cy_en_syspm_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__sar__functions__power.html#ga46e3b5906aad114fb19f15f3ebbc8de2">Cy_SAR_DeepSleepCallback</a> (const <a class="el" href="structcy__stc__syspm__callback__params__t.html">cy_stc_syspm_callback_params_t</a> *callbackParams, <a class="el" href="group__group__syspm__data__enumerates.html#gae06cd8869fe61d709ad6145ca9f3cd63">cy_en_syspm_callback_mode_t</a> <a class="el" href="group__group__ipc__bt__data__structures.html#ga37e90f5e3bd99fac2021fb3a326607d4">mode</a>)</td></tr>
<tr class="memdesc:ga46e3b5906aad114fb19f15f3ebbc8de2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Callback to prepare the SAR before entering Deep Sleep and to re-enable the SAR after exiting Deep Sleep.  <a href="#ga46e3b5906aad114fb19f15f3ebbc8de2">More...</a><br /></td></tr>
<tr class="separator:ga46e3b5906aad114fb19f15f3ebbc8de2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7f5da233753269fdf05b5745515a7c21"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__sar__functions__power.html#ga7f5da233753269fdf05b5745515a7c21">Cy_SAR_DeepSleep</a> (<a class="el" href="struct_s_a_r___type.html">SAR_Type</a> *base)</td></tr>
<tr class="memdesc:ga7f5da233753269fdf05b5745515a7c21"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is the preferred routine to prepare the hardware for Deep Sleep.  <a href="#ga7f5da233753269fdf05b5745515a7c21">More...</a><br /></td></tr>
<tr class="separator:ga7f5da233753269fdf05b5745515a7c21"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gacc90443f509ee778eef2cdacce33128f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__sar__functions__power.html#gacc90443f509ee778eef2cdacce33128f">Cy_SAR_Wakeup</a> (<a class="el" href="struct_s_a_r___type.html">SAR_Type</a> *base)</td></tr>
<tr class="memdesc:gacc90443f509ee778eef2cdacce33128f"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is the preferred routine to restore the hardware to the state after calling <a class="el" href="group__group__sar__functions__power.html#ga7f5da233753269fdf05b5745515a7c21">Cy_SAR_DeepSleep</a>.  <a href="#gacc90443f509ee778eef2cdacce33128f">More...</a><br /></td></tr>
<tr class="separator:gacc90443f509ee778eef2cdacce33128f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga46e3b5906aad114fb19f15f3ebbc8de2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga46e3b5906aad114fb19f15f3ebbc8de2">&#9670;&nbsp;</a></span>Cy_SAR_DeepSleepCallback()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__syspm__data__enumerates.html#ga601b1cb722cb091133caf33d8ab235ca">cy_en_syspm_status_t</a> Cy_SAR_DeepSleepCallback </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structcy__stc__syspm__callback__params__t.html">cy_stc_syspm_callback_params_t</a> *&#160;</td>
          <td class="paramname"><em>callbackParams</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__syspm__data__enumerates.html#gae06cd8869fe61d709ad6145ca9f3cd63">cy_en_syspm_callback_mode_t</a>&#160;</td>
          <td class="paramname"><em>mode</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Callback to prepare the SAR before entering Deep Sleep and to re-enable the SAR after exiting Deep Sleep. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">callbackParams</td><td>Pointer to structure of type <a class="el" href="structcy__stc__syspm__callback__params__t.html">cy_stc_syspm_callback_params_t</a></td></tr>
    <tr><td class="paramname">mode</td><td>Callback mode, see <a class="el" href="group__group__syspm__data__enumerates.html#gae06cd8869fe61d709ad6145ca9f3cd63">cy_en_syspm_callback_mode_t</a></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>See <a class="el" href="group__group__syspm__data__enumerates.html#ga601b1cb722cb091133caf33d8ab235ca">cy_en_syspm_status_t</a></dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd></dd></dl>
<div class="fragment"><div class="line">    </div><div class="line">    <span class="comment">/* Scenario: Before putting the device into Deep Sleep mode,</span></div><div class="line"><span class="comment">     * the SAR Deep Sleep callback must be registered to ensure</span></div><div class="line"><span class="comment">     * proper Deep Sleep entry and exit. */</span></div><div class="line">    </div><div class="line">    <span class="comment">/* Set the base address pointer to the SAR hardware block. */</span></div><div class="line">    <span class="keyword">static</span> <a class="code" href="structcy__stc__syspm__callback__params__t.html">cy_stc_syspm_callback_params_t</a> SARDeepSleepCallbackParams =</div><div class="line">    {</div><div class="line">        <span class="comment">/* .base    */</span> SAR_HW,</div><div class="line">        <span class="comment">/* .context */</span> NULL</div><div class="line">    };</div><div class="line">    </div><div class="line">    <span class="comment">/* Attach the Cy_SAR_DeepSleepCallback function and set the callback parameters. */</span></div><div class="line">    <span class="keyword">static</span> <a class="code" href="structcy__stc__syspm__callback__t.html">cy_stc_syspm_callback_t</a> SARDeepSleepCallbackStruct =</div><div class="line">    {</div><div class="line">        <span class="comment">/* .callback        */</span> (<a class="code" href="group__group__syspm__data__structures.html#ga0b54e47bca8fb045d86884a9b3d12067">Cy_SysPmCallback</a>)(&amp;<a class="code" href="group__group__sar__functions__power.html#ga46e3b5906aad114fb19f15f3ebbc8de2">Cy_SAR_DeepSleepCallback</a>),</div><div class="line">        <span class="comment">/* .type            */</span> <a class="code" href="group__group__syspm__data__enumerates.html#gga8c2960c0164ead1cfa86e7d6846b6ff0abc51d74deff0ceea4304b01b2d57bd9d">CY_SYSPM_DEEPSLEEP</a>,</div><div class="line">        <span class="comment">/* .skipMode        */</span> 0UL,</div><div class="line">        <span class="comment">/* .callbackParams  */</span> &amp;SARDeepSleepCallbackParams,</div><div class="line">        <span class="comment">/* .prevItm         */</span> NULL,</div><div class="line">        <span class="comment">/* .nextItm         */</span> NULL,</div><div class="line">        <span class="comment">/* .order           */</span> 0</div><div class="line">    };</div><div class="line">    </div><div class="line">    <span class="comment">/* Register the callback before entering Deep Sleep mode. */</span></div><div class="line">    <a class="code" href="group__group__syspm__functions__callback.html#ga0d58b00c8dc764a6371590f70e2f73c7">Cy_SysPm_RegisterCallback</a>(&amp;SARDeepSleepCallbackStruct);</div><div class="line">    </div><div class="line">    <span class="comment">/* Put the device into Deep Sleep mode and wait for an interrupt to wake up. */</span></div><div class="line">    Cy_SysPm_DeepSleep(<a class="code" href="group__group__syspm__data__enumerates.html#ggaae6a9f528630a2d69bb70b3bced1f0acadf47e50b6700c08b6f9e7e70bb525541">CY_SYSPM_WAIT_FOR_INTERRUPT</a>);</div></div><!-- fragment -->
</div>
</div>
<a id="ga7f5da233753269fdf05b5745515a7c21"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7f5da233753269fdf05b5745515a7c21">&#9670;&nbsp;</a></span>Cy_SAR_DeepSleep()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_SAR_DeepSleep </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_s_a_r___type.html">SAR_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is the preferred routine to prepare the hardware for Deep Sleep. </p>
<p>It will call <a class="el" href="group__group__sar__functions__basic.html#ga1397031ccf2c1f8a5a95a77f9362e1d1">Cy_SAR_StopConvert</a> to disable continuous conversions and wait for SAR conversions to stop before entering Deep Sleep. If the SARMUX is not configured for Deep Sleep operation, the entire SAR hardware block will be turned off.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to structure describing registers</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd></dd></dl>
<p>This function is used in the <a class="el" href="group__group__sar__functions__power.html#ga46e3b5906aad114fb19f15f3ebbc8de2">Cy_SAR_DeepSleepCallback</a>. There is no need to call this function directly. </p>

</div>
</div>
<a id="gacc90443f509ee778eef2cdacce33128f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gacc90443f509ee778eef2cdacce33128f">&#9670;&nbsp;</a></span>Cy_SAR_Wakeup()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_SAR_Wakeup </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_s_a_r___type.html">SAR_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is the preferred routine to restore the hardware to the state after calling <a class="el" href="group__group__sar__functions__power.html#ga7f5da233753269fdf05b5745515a7c21">Cy_SAR_DeepSleep</a>. </p>
<p>Restoring the hardware involves re-enabling the hardware, the reference buffer, and continuous scanning if it was previously enabled before entering sleep.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to structure describing registers</td></tr>
  </table>
  </dd>
</dl>
<dl class="section user"><dt>Side Effects</dt><dd>Calling this function without previously calling <a class="el" href="group__group__sar__functions__power.html#ga7f5da233753269fdf05b5745515a7c21">Cy_SAR_DeepSleep</a> can lead to unpredictable results.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd>None</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd></dd></dl>
<p>This function is used in the <a class="el" href="group__group__sar__functions__power.html#ga46e3b5906aad114fb19f15f3ebbc8de2">Cy_SAR_DeepSleepCallback</a>. There is no need to call this function directly. </p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>MTB CAT1 Peripheral driver library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
